import React,{Component} from 'react'
import {Layout,BackTop} from 'antd'
import {HashRouter as Router, Route,Redirect,Switch} from 'react-router-dom'
import CartHeader from '../components/cart/CartHeader'
import CartFooter from '../components/cart/CartFooter'
import OrderConfirm from '../components/cart/OrderConfirm'
import Myself from '../components/myself/Myself'
import CheckBag from '../components/cart/CheckBag'
import '../components/cart/cart.css'
import Payfor from '../components/cart/Payfor'

const {Header,Content,Footer} =Layout

export default class Cart extends Component{
    submit(val){
        console.log(val)
    }
    tap(){
      window.location.href='/home'
    }
    render(){
        return(
            <div>
                <Layout>
                <Header>
                    <CartHeader/>
                </Header>
                <Content style={{paddingTop:'15px'}}>
                    <Router>
                        <Route path="/cart/checkbag" component={CheckBag}/>
                        <Route path="/cart/orderConfirm" component={OrderConfirm}/>
                        <Route path="/cart/myself" component={Myself} />
                        <Route path="/cart/payfor" component={Payfor} />
                    </Router>
                </Content>
                <Footer>
                    <CartFooter/>
                </Footer>
                </Layout>
                <BackTop visibilityHeight={100}>
                <div className="ant-back-top-inner">TOP</div>
                <button onClick={()=>this.tap()} className="backHome">返回 <br/>   首页</button>
              </BackTop>
                
            </div>
        )
    }
}